﻿using System;
using System.ComponentModel;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace SeaSharpTestApp
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page, INotifyPropertyChanged
    {
       private Windows.UI.Color _shadowColor;
       public Windows.UI.Color ShadowColor
       {
          get
          {
             return _shadowColor;
          }
          set
          {
             _shadowColor = value;
             if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs("ShadowColor"));
          }
       }

        public MainPage()
        {
            this.InitializeComponent();
            renderStrategy.ItemsSource = Enum.GetValues(typeof(XamlFx.RenderStrategy));
            renderStrategy.SelectedItem = XamlFx.RenderStrategy.RenderingEvent;

            sliderR.ValueChanged += sliderX_ValueChanged;
            sliderG.ValueChanged += sliderX_ValueChanged;
            sliderB.ValueChanged += sliderX_ValueChanged;

            _shadowColor = Windows.UI.Colors.Black;
        }

        void sliderX_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
        {
           ShadowColor = Windows.UI.Color.FromArgb(255, (byte)sliderR.Value, (byte)sliderG.Value, (byte)sliderB.Value);
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
